package cn.schtwz.baseproject

import android.app.Application
import cn.schtwz.baseproject.di.httpClientModule
import cn.schtwz.baseproject.di.aliOssModule
import cn.schtwz.baseproject.di.serviceModule
import cn.schtwz.baseproject.ui.homeEmergency.homeEmEModule
import cn.schtwz.baseproject.ui.homeList.homeListModule
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin

class MyApplication : Application() {
    val diModules = arrayOf(httpClientModule, serviceModule, aliOssModule,homeListModule, homeEmEModule)
    override fun onCreate() {
        super.onCreate()
        INSTANCE = this
        startKoin {
            androidLogger()
            androidContext(this@MyApplication)
            modules(diModules.asList())
        }
    }

    companion object {
        lateinit var INSTANCE: MyApplication
    }

}